package com.yyy.example;

import com.yyy.common.Interceptors.IMsgCallbackHandler;
import com.yyy.common.annotation.CallbackHandler;
import com.yyy.entity.Message;
import lombok.extern.slf4j.Slf4j;
import org.springframework.jca.cci.core.InteractionCallback;
import org.springframework.stereotype.Component;

/**
 * @author yyy
 * @Date 2020-11-15 21:47
 * @Email yangyouyuhd@163.com
 */
@Slf4j
@Component
@CallbackHandler(name = QueueNameList.q2)
public class ExampleMsgCallbackHandler implements IMsgCallbackHandler {
    @Override
    public void returnCallback(Message msg) {
        log.error("消息消费成功:"+msg);
    }

    @Override
    public void afterCallback(Message msg,Exception e) {
        log.error("消息消费异常:"+msg);
        log.error(e.getMessage());
        e.printStackTrace();
    }
}
